Skip to content

Implement the task list-supported template#453

Draft
armoj wants to merge 9 commits intorc-tasklistfrom
feature/task-list/rc
Draft

Implement the task list-supported template#453
armoj wants to merge 9 commits intorc-tasklistfrom
feature/task-list/rc

Conversation

@armoj
Copy link
Contributor

@armoj armoj commented Jun 17, 2024

No description provided.

@armoj armoj self-assigned this Jun 17, 2024
@armoj armoj force-pushed the feature/task-list/rc branch 3 times, most recently from f36b622 to 718e796 Compare June 17, 2024 14:24
@armoj armoj force-pushed the feature/task-list/rc branch 8 times, most recently from c2d18fb to e8ca350 Compare June 28, 2024 16:05
@armoj armoj force-pushed the feature/task-list/rc branch 3 times, most recently from b55ff94 to 1362a42 Compare July 15, 2024 10:24
const questionnaire = createQuestionnaireHelper({questionnaireDefinition});
const taskListService = createTaskListService({questionnaireDefinition});

const section = questionnaire.getSection(sectionId);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than using questionnaire.getSection() then section.getSchema() you could just get the schema by using questionnaire.getSectionDefinition().schema

const {states} = questionnaireDefinition.routes;

if (supportsTaskList(questionnaireDefinition)) {
const tasks = states;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary?

const AjvErrors = require('ajv-errors');
const VError = require('verror');
const createQRouter = require('q-router');
const router = require('q-router');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not necessary, the module is still called q-router!

previousProgressEntryLink = `${process.env.DCS_URL}/api/questionnaires/${
questionnaire.id
}/progress-entries?filter[sectionId]=${qRouter.previous(sectionId).id}`;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine for now, but we should chuck a ToDo in to get rid of this. Would be trivial for q-router to return the correct thing rather than being queried by the DCS

}

// TODO: pass in the sectionSchema, not the sectionId. OR
// TODO: get schema from sectionId and interrogate the shape instead of the IDs value.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another reason to improve the progress entries function

}

return taskApplicabilityStatus;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand what you've done here, but I think it should be:

const status = taskApplicabilityStatus = 'applicable' ? taskCompletionStatus : taskApplicabilityStatus

It's not a perfect solution but I think it's just far easier to read and understand than these precedence arrays.

@BarryPiccinni BarryPiccinni force-pushed the feature/task-list/rc branch from 1362a42 to 51316e0 Compare July 22, 2024 13:21
@armoj armoj force-pushed the rc-tasklist branch 4 times, most recently from 54ebc73 to ebf26e0 Compare October 2, 2024 16:00
@armoj armoj force-pushed the rc-tasklist branch 2 times, most recently from b6673c8 to 2e64e6b Compare October 7, 2024 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants